<?php

/*
* @author ducnhat
* @email ddnhat@gmail.com
* @copyright 2014
*/

class Zenddn_View_Helper_Social extends Zend_View_Helper_Abstract{
    
    public function social($key){
        $cache = new Zenddn_System_Cache();
        $cache = $cache->getCache();  
        $key_replace = str_ireplace(" ", "_", $key);
        $cache_id = "social_{$key_replace}";
        
        if(($info = $cache->load($cache_id)) === false){
            $model = new Default_Model_Setting();
            $info = $model->getData('social');
            $info = unserialize($info['value']);
            
            $cache->save($info, $cache_id, array('setting'));
        }
        
        return $info[$key];
    }
}